package Beans;

import Bank.Account;
import Bank.User;
import org.apache.log4j.Logger;

import java.lang.annotation.Annotation;
import java.util.ArrayList;

@javax.ejb.Stateless(name = "AuthorizationEJB")
public class AuthorizationBean implements AuthorizationBeanInterface {
    private static final Logger log = Logger.getLogger(AuthorizationBean.class);
    private User user;
    public AuthorizationBean(User user1) {
        user  = user1;
    }

    public AuthorizationBean() {
    }

    @Override
    public String getMessage( ) {

        return "Привет " + user.getName() + "!";
    }


    @Override
    public String getUserName() {
        return user.getName();
    }

    @Override
    public String getUserLogin() {
        return user.getLogin();
    }

    @Override
    public String getUserId() {
        return user.getId().toString();
    }

    @Override
    public String getUserEmail() {
       return user.getMail();
    }

    @Override
    public String getUserPhone() {
        return  user.getPhone();
    }

    @Override
    public ArrayList<Account> getAccounts() {
        return user.getAccounts();
    }

    @Override
    public String name() {
        return null;
    }

    @Override
    public String description() {
        return null;
    }

    @Override
    public String beanName() {
        return null;
    }

    @Override
    public Class beanInterface() {
        return null;
    }

    @Override
    public String mappedName() {
        return null;
    }


    public String lookup() {
        return null;
    }

    @Override
    public boolean equals(Object obj) {
        return false;
    }

    @Override
    public int hashCode() {
        return 0;
    }

    @Override
    public String toString() {
        return null;
    }

    @Override
    public Class<? extends Annotation> annotationType() {
        return null;
    }
}
